<template>
	<Switch v-model="a" :true-value="1" :false-value="0" @on-change="onChange">
		<template #open>
			<slot name="open"></slot>
		</template>
		<template #close>
			<slot name="close"></slot>
		</template>
	</Switch>
</template>
<script>
export default {
	props: ['value'],
	data() {
		return {
			a: 0
		}
	},
	mounted() {
		console.log(this.value);
		this.a = this.value
	},
	methods: {
		onChange(e) {
			console.log(e);
			this.$emit('update:value', e);
		}
	}
}
</script>

<style lang="scss" scoped></style>